//
//  UIview+Extension.swift
//  sina
//
//  Created by DXapple on 15/11/19.
//  Copyright © 2015年 sqlite. All rights reserved.
//

import UIKit
extension UIView {

//通过响应者链条找到导航控制器
    func NavController() -> UINavigationController? {
        //通过遍历响应者链条获取当前视图对象的
        var next = self.nextResponder()
        repeat {
            if next is UINavigationController {
                return next as? UINavigationController
            }
            next = next?.nextResponder()
        } while ( next != nil)
        return nil
        
        
        
        
    }
    

}
